<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function sum(){
				if(arguments.length == 0){
					return 0;
				}
				var s = 0;
				for(var i = 0;i<arguments.length;i++){
					s+=arguments[i]
				}
				alert(s)
				return s;
			}
		</script>
	</head>
	<body>
		<input type="button" value = "1-3" onclick="sum(1,2,3)">
		<input type="button" value = "6-9" onclick="sum(6,7,8,9)">
		<p>
			<span id='result'></span>
		</p>
	</body>
</html>